<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/kaoqin.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
    <style>
        a{color:#1781d0;}
        p{text-align: left;margin-left:20px;}
        .layui-table,.layui-table th{ text-align:left; }
        .feed-ext-list {
            margin: 0;
            list-style: none;
            clear: both;
            *+zoom: 1;
        }
        .feed-cmt-list-item {
            position: relative;
            padding: 5px 0;
            border-top: 1px dashed #CCC;
            margin: 0 20px;
        }
        .feed-ext-body a, .feed-ext-body a:link, .feed-ext-body a:visited, .feed-ext-body a:hover, .feed-ext-body a:active {
            color: #2A94CF;
        }
        .feed-ext-body a {
            margin: 0 3px;
        }
        .feed-cmt-list-ext {
            position: absolute;
            right: 5px;
            top: 5px;
        }
        .feed-cmt-content {
            padding: 4px;
            line-height: 1.3;
        }
        .feed-cmt-list-item.sub {
            padding: 1px 18px;
            padding-left: 18px;
            padding-left: 40px;
            border-top: 0;
        }
        .feed-cmt-del-handle, .feed-cmt-reply-handle {
            float: right;
            margin-right:5px;
        }
        .feed-cmt-list-time {
            color: #A8A8A8;
            margin-right: 5px;
            float: right;
        }
        a:link {
            color: #0066cc;
            text-decoration: none;
        }
    </style>
</block>
<block name="content" >
    <section class="layui-larry-box mian-page page-attendanceStatistics">
	<div class="larry-personal">
            <div class="layui-tab">
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box tabRedefine layui-tab-brief">
                    <div class="layui-tab-item layui-field-box layui-show absence">
                        <div style="width:100%;margin: 10px auto;">
                            <a href="{:U('saveDiary')}" style="color:#fff;width:65px;font-size:15px;background: #1781d0;padding:8px 10px;">写日志</a>
                            <if condition="$is_view neq 0">
                                <a href="{:U('searchDiary',array('is_view'=>$is_view))}" style="color:#fff;width:65px;font-size:15px;background: #1781d0;padding:8px 10px;">日志查询</a>
                            </if>
                            <table class="layui-table setTabBg out" lay-skin="line" style="margin-top:15px;">
                                <tbody>
                                    <notempty>
                                        <foreach name='diary' item='data'>
                                            <tr>
                                                <td style="width:70px;text-align:left;vertical-align: text-top;">
                                                    <a href="{:U('searchDiary',array('is_view'=>2,'user_id'=>$data['user_id']))}"><img src="{$data.head}" style="width:64px;height:64px;"/>
                                                </td>
                                                <td>
                                                    <div style="border:1px solid #e2e2e2;background:#fff;">
                                                        <p>
                                                            <span>{$data.user_name}</span>
                                                            <span style='float:right;color:#aaa;'>{$data.dia_time}</span>
                                                        </p>
                                                        <p style="clear:both;"></p>
                                                        <p style='font-size: 15px;font-weight: bolder;'>{$data.subject}</p>
                                                        <p>{$data.content}</p>
                                                        <p class="lastItem" style='text-align: right;padding-right:10px;padding-top: 50px;'>
                                                            <a class='pointer comment_diary' data-id='{$data.dia_id}'>评论({$data.comment_count})</a>
                                                            <a class='pointer' href='{:U("saveDiary",array("dia_id"=>$data["dia_id"]))}'>编辑</a>
                                                            <a class='pointer delDiary' data-url="{:U('delDiary',array('dia_id'=>$data['dia_id']))}">删除</a>
                                                            <!--<a class='pointer'>浏览</a>-->
                                                        </p>
                                                    </div>
                                                    <div style="border-top:0;border:1px solid #e2e2e2;height:auto;background:#fff;">
                                                        <ul class="feed-ext-list">
                                                            <foreach name='data["comment"]' item='comment'>
                                                                <li class="feed-cmt-list-item " data-cmt-id="{$comment.comment_id}" data-comment-to-id="">     
                                                                    <a href="javascript:void(0);" td-user-id="{$comment.user_id}" class="feed-cmt-list-user">{$comment.user_id|getChineseName}</a> 
                                                                    <div class="feed-cmt-list-ext">                  
                                                                        <a class="feed-cmt-del-handle delReply pointer" data-cmt-type="comment" data-url="{:U('delDiaryComment',array('comment_id'=>$comment['comment_id']))}">删除</a> 
                                                                        <a class="feed-cmt-reply-handle replyCommentDiary pointer" data-cmt-id="{$comment.comment_id}" data-to-id="{$comment.user_id}" data-cmt-type="" data-to-text="{$comment.user_id|getChineseName}" data-dia-id="{$data.dia_id}">回复</a>                   
                                                                        <span class="feed-cmt-list-time" title="{$comment.send_time}" data-timestamp="{$comment.timestamp}">{$comment.send_time} </span>    
                                                                    </div>     
                                                                    <div class="feed-cmt-content">{$comment.content}</div>     
                                                                        <div class="feed-cmt-attachments">             
                                                                    </div> 
                                                                </li>
                                                                <foreach name='comment["reply"]' item="reply">
                                                                    <li class="feed-cmt-list-item sub" data-cmt-id="4" data-comment-to-id="12">
                                                                        <a td-user-id="{$reply.replyer}" class="feed-cmt-list-user">{$reply.replyer|getChineseName}</a>
                                                                        回复
                                                                        <a td-user-id="{$comment.user_id}" class="feed-cmt-list-user">{$comment.user_id|getChineseName}</a>
                                                                        <div class="feed-cmt-list-ext">
                                                                                <a class="pointer feed-cmt-del-handle delReply" data-cmt-type="reply" data-url="{:U('delDiaryComment',array('reply_id'=>$reply['reply_id']))}">删除 </a>                           
                                                                                <span class="feed-cmt-list-time" title="2018-07-18 13:43:44" data-timestamp="1531892624">{$reply.reply_time}</span>    
                                                                        </div>    
                                                                        <div class="feed-cmt-content">{$reply.reply_comment}</div>     
                                                                    
                                                                    </li>
                                                                </foreach>
                                                            </foreach>
                                                        </ul>
                                                    </div>
                                                </td>
                                            <tr>
                                        </foreach>
                                    </notempty>
                                </tbody>
                            </table>
                        </div>
			
                    </div>
                    <div class="layui-block">共{$count}条数据</div>
                    <div class="larry-table-page clearfix">
                        <div id="page" class="page">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/personal.js"></script>
    <script type="text/javascript">
        $(initPersonal());
    </script>
</block>